<?php
set_include_path ( $_SERVER ['DOCUMENT_ROOT'] );
include_once 'admin/includes/functions/admin-functions.php';
global $DBobject, $SMARTY, $CONFIG;


$fsql = "SELECT franchisee_object_id as id,CONCAT(franchisee_name,' (',admin_name,' ',admin_surname,') Tel:',admin_telephone) AS value FROM tbl_franchisee LEFT JOIN tbl_access ON franchisee_object_id = access_franchisee_id LEFT JOIN tbl_admin ON access_admin_id = admin_id WHERE franchisee_deleted IS NULL AND franchisee_published = 1 AND access_deleted IS NULL AND admin_deleted IS NULL AND admin_level = 2 GROUP BY franchisee_name ORDER BY franchisee_name";
$franchiseelist = $DBobject->wrappedSql($fsql);
$SMARTY->assign("franchises",$franchiseelist);

